<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
<meta charset="UTF-8"></meta>
<title>Insert title here</title>
<link rel="stylesheet" type="text/css"
	th:href="@{/static/easyui/themes/default/easyui.css}"></link>
<link rel="stylesheet" type="text/css"
	th:href="@{/static/easyui/themes/icon.css}"></link>
<script th:src="@{/static/easyui/jquery.min.js}"></script>
<script th:src="@{/static/easyui/jquery.easyui.min.js}"></script>
<script th:src="@{/static/easyui/locale/easyui-lang-zh_CN.js}"></script>
</head>
<body style="text-align: center; background-image: url(../static/images/login_bg.gif) ">
	<div style="width: 400px; margin: 10% auto;">
		<div class="easyui-panel" title="用户登录"
			style="width: 100%; max-width: 400px; padding: 30px 60px;">

			<form id="f" class="easyui-form" method="POST"
				style="width: 300px; margin: 0 auto;"
				data-options="novalidate: true">
				<div style="margin-bottom: 10px">
					<input class="easyui-textbox" name="username"
						style="width: 100%; height: 40px; padding: 12px"
						data-options="iconCls:'icon-man',iconWidth:38,required:true" />
				</div>
				<div style="margin-bottom: 20px">
					<input class="easyui-passwordbox" name="password"
						style="width: 100%; height: 40px; padding: 12px"
						data-options="required:true,iconCls:'icon-lock',iconWidth:38" />
				</div>
				<div style="margin-bottom: 20px">
					<input id="remember" type="checkbox" checked="checked" /> <span>记住我</span>
				</div>

				<div style="text-align: center; padding: 5px 0">
					<a href="javascript:void(0)" class="easyui-linkbutton"
						onclick="submitForm()" style="padding: 5px 0px; width: 30%;"
						data-options="iconCls:'icon-ok'">登录</a> <a
						href="javascript:void(0)" class="easyui-linkbutton"
						onclick="clearForm()" style="padding: 5px 0px; width: 30%;"
						data-options="iconCls:'icon-reload'">重置</a> <a
						th:href="@{/spitter/register}" class="easyui-linkbutton"
						style="padding: 5px 0px; width: 30%;"
						data-options="iconCls:'icon-tip'">注册</a> <a id="ttt"
						href="javascript:void(0)">test</a>
						<a id="gohome" th:href="@{/}"></a>
						<a id="gologin" th:href="@{/login}"></a>
				

				</div>
			</form>
		</div>
	</div>
	<script>
		
		$(document).ready(function() {
			$("#ttt").click(function() {
				$.post($("#gologin").attr("href"), {
					username : 'ft123',
					password : '123123'
				}, function(data, status, xhr) {
					//window.location.href = $("#gohome").attr("href");
					//alert("Data:" + data + "nStatus:"+ status + "xhr" + xhr);
					window.location.href = $("#gohome").attr("href");
					//window.location.reload();
					//document.write(data);
					//$(document).html(data);  
					//$("#gohome").click();
				});
			});
		});
		function submitForm() {
			$('#f').form('submit', {
				url: $("#gologin").attr("href"),
				onSubmit : function() {
					return $(this).form('enableValidation').form('validate');
				},
				success : function(data) {
					//alert(data);
					window.location.href = $("#gohome").attr("href");
				}
			});
		}
		function clearForm() {
			$('#f').form('reset');
		}
	</script>
</body>
</html>